#include("../_common/form_input.html")
#include("../_common/form_textarea.html")
#@admin_header()
<!-- 内容主体区域 -->
<div class="layui-body">
  <div style="padding: 15px;">
    <form class="layui-form layui-form-pane">
      #@form_input("page_size", "数据数量", dp.getPageSize(), "请输入数据大小", "api查询数据时，每页的显示数据的条数，int类型")
      #@form_textarea("head_code", "头部代码", dp.getHeadCode(), "头部代码", "每个页面head标签之间的代码")
      #@form_textarea("foot_code", "底部代码", dp.getFootCode(), "可以是统计代码", "每个页面里用来统计访问来源的代码")
      <div class="layui-form-item">
        <div class="layui-input-block">
          <button class="layui-btn" lay-filter="otherConfig" lay-submit="">立即提交</button>
          <button class="layui-btn layui-btn-primary" type="reset">重置</button>
        </div>
      </div>
    </form>
  </div>
</div>
<script>
  //JavaScript代码区域
  layui.use(['form'], function () {
    var form = layui.form;
    form.render();
    // 提交
    form.on('submit(otherConfig)', function (data) {
      ToastLoading('正在保存...');
      $.post("#(adminRoot)/setting/other/save", data.field)
        .success(function (ret) {
          ToastShow(ret.code, ret.msg, ret.url);
        })
        .error(function () {
          ToastErr('网络错误');
        })
      return false;
    });
  });
</script>
#@admin_footer()
